//
//  OldTwoTableViewCell.m
//  Item A House
//
//  Created by 甄奇文 on 15/5/26.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "OldTwoTableViewCell.h"
#import "MapViewController.h"
@implementation OldTwoTableViewCell
- (void)dealloc
{
    [_housepic release];
    [_addrinfo release];
    [_smallareaid release];
    [_areainfo release];
    [_v_houselayout release];
    [_v_housesize release];
    [_v_price release];
    [_c_pricepersqm release];
    [_houseward release];
    [_fitment release];
    [_property release];
    [_title release];
    [_xuequ release];
    [_xqaddress release];
    [_housefeature release];
    [_aSp release];
    [_huxing release];
    [_price release];
    [_large release];
    [_intro release];
    [_maping release];
    [_address release];
    [_way release];
    [_school release];
    [_hospital release];
    [super dealloc];
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView
{
    self.housepic = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 160)];
    [self.contentView addSubview:self.housepic];
    [self.housepic release];
    
    //小区名
    self.addrinfo = [[UILabel alloc] initWithFrame:CGRectMake(10, 160, [UIScreen mainScreen].bounds.size.width / 2 - 10, 30)];
    [self.addrinfo setFont:[UIFont fontWithName:@"Helvetica-Bold" size:18]];
    [self.contentView addSubview:self.addrinfo];
    [self.addrinfo release];
    
    //地址
    self.areainfo = [[UILabel alloc] initWithFrame:CGRectMake(10, 195, [UIScreen mainScreen].bounds.size.width / 2 - 10, 10)];
    self.areainfo.textColor = [UIColor colorWithWhite:0.3 alpha:0.8];
    self.areainfo.font = [UIFont systemFontOfSize:13];;
    [self.contentView addSubview:self.areainfo];
    [self.areainfo release];
    
    //次级地址
    self.smallareaid = [[UILabel alloc] initWithFrame:CGRectMake(65, 195, [UIScreen mainScreen].bounds.size.width / 2 - 70, 10)];
    self.smallareaid.textColor = [UIColor colorWithWhite:0.3 alpha:0.8];
    self.smallareaid.font = [UIFont systemFontOfSize:13];;
    [self.contentView addSubview:self.smallareaid];
    [self.smallareaid release];
    
    //分割线
    self.aSp = [[UIView alloc] initWithFrame:CGRectMake(0, 215, [UIScreen mainScreen].bounds.size.width, 1)];
    [self.aSp setBackgroundColor:[UIColor grayColor]];
    [self.contentView addSubview:self.aSp];
    [self.aSp release];
    
    
    self.price = [[UILabel alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width / 12, 220, [UIScreen mainScreen].bounds.size.width / 2 - 10, 30)];
    self.price.text = @"价格💰";
    [self.contentView addSubview:self.price];
    [self.price release];
    
    self.v_price = [[UILabel alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width / 12, 250, [UIScreen mainScreen].bounds.size.width / 2 - 10, 30)];
    self.v_price.textColor = [UIColor redColor];
    [self.contentView addSubview:self.v_price];
    [self.v_price release];
    
    self.huxing = [[UILabel alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width / 2 - [UIScreen mainScreen].bounds.size.width / 12, 220
    , [UIScreen mainScreen].bounds.size.width / 2 - 10, 30)];
    self.huxing.text = @"户型🏠";
    [self.contentView addSubview:self.huxing];
    [self.huxing release];
    
    self.v_houselayout = [[UILabel alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width / 2 - [UIScreen mainScreen].bounds.size.width / 12, 250, [UIScreen mainScreen].bounds.size.width / 2 - 10, 30)];
    self.v_houselayout.textColor = [UIColor redColor];
    [self.contentView addSubview:self.v_houselayout];
    [self.v_houselayout release];
    
    self.large = [[UILabel alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width / 2 + [UIScreen mainScreen].bounds.size.width / 4, 220
    , [UIScreen mainScreen].bounds.size.width / 2 - 10, 30)];
    self.large.text = @"面积🇨🇳";
    [self.contentView addSubview:self.large];
    [self.large release];
    
    self.v_housesize = [[UILabel alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width / 2 + [UIScreen mainScreen].bounds.size.width / 4, 250, [UIScreen mainScreen].bounds.size.width / 2 - 10, 30)];
    self.v_housesize.textColor = [UIColor redColor];
    [self.contentView addSubview:self.v_housesize];
    [self.v_housesize release];
    
    
    //单价
    self.c_pricepersqm = [[UILabel alloc] initWithFrame:CGRectMake(30, 290, [UIScreen mainScreen].bounds.size.width / 2, 30)];
    [self.contentView addSubview:self.c_pricepersqm];
    [self.c_pricepersqm release];
    
    
    //朝向
    self.houseward = [[UILabel alloc] initWithFrame:CGRectMake(220, 290, [UIScreen mainScreen].bounds.size.width / 3, 30)];
    [self.contentView addSubview:self.houseward];
    [self.houseward release];
    
    //装修
    self.fitment = [[UILabel alloc] initWithFrame:CGRectMake(30, 330, [UIScreen mainScreen].bounds.size.width / 3, 30)];
    [self.contentView addSubview:self.fitment];
    [self.fitment release];
    
    //权属
    self.property = [[UILabel alloc] initWithFrame:CGRectMake(220, 330, [UIScreen mainScreen].bounds.size.width / 3, 30)];
    [self.contentView addSubview:self.property];
    [self.property release];
    
    
    self.intro = [[UILabel alloc] initWithFrame:CGRectMake(0, 376, [UIScreen mainScreen].bounds.size.width - 10, 40)];
    self.intro.text = @" 房源特点:";
    self.intro.font = [UIFont fontWithName:@"Helvetica-Bold" size:16];
    [self.intro setBackgroundColor:[UIColor colorWithWhite:0.3 alpha:0.2]];
    [self.contentView addSubview:self.intro];
    [self.intro release];
    
    self.title = [[UILabel alloc] initWithFrame:CGRectMake(10, 420, [UIScreen mainScreen].bounds.size.width - 10, 30)];
    [self.contentView addSubview:self.title];
    [self.title release];
    
    self.xuequ = [[UILabel alloc] initWithFrame:CGRectMake(10, 450, [UIScreen mainScreen].bounds.size.width - 10, 30)];
    [self.contentView addSubview:self.xuequ];
    [self.xuequ release];
    
    self.xqaddress = [[UILabel alloc] initWithFrame:CGRectMake(10, 480, [UIScreen mainScreen].bounds.size.width - 10, 40)];
    self.xqaddress.numberOfLines = 0;
    [self.contentView addSubview:self.xqaddress];
    [self.xqaddress release];
    
    self.housefeature = [[UILabel alloc] initWithFrame:CGRectMake(10, 510, [UIScreen mainScreen].bounds.size.width - 10, 160)];
    self.housefeature.numberOfLines = 0;
    [self.contentView addSubview:self.housefeature];
    [self.housefeature release];
    
    self.intro = [[UILabel alloc] initWithFrame:CGRectMake(0, 690, [UIScreen mainScreen].bounds.size.width, 40)];
    self.intro.text = @" 房源周边:";
    self.intro.font = [UIFont fontWithName:@"Helvetica-Bold" size:16];
    [self.intro setBackgroundColor:[UIColor colorWithWhite:0.3 alpha:0.2]];
    [self.contentView addSubview:self.intro];
    [self.intro release];
    
//    //地图
//    self.maping = [[UIImageView alloc] initWithFrame:CGRectMake(0, 730, [UIScreen mainScreen].bounds.size.width, 160)];
//    [self.contentView addSubview:self.maping];
//    [self.maping release];
    
    //地址
    self.address = [[UILabel alloc] initWithFrame:CGRectMake(10, 730, [UIScreen mainScreen].bounds.size.width, 20)];
    [self.contentView addSubview:self.address];
    [self.address release];
    
    //周边交通
    self.way = [[UILabel alloc] initWithFrame:CGRectMake(10, 750, [UIScreen mainScreen].bounds.size.width - 10, 60)];
    self.way.numberOfLines = 0;
    [self.contentView addSubview:self.way];
    [self.way release];
    
    self.school = [[UILabel alloc] initWithFrame:CGRectMake(10, 810, [UIScreen mainScreen].bounds.size.width - 10, 40)];
    self.school.numberOfLines = 0;
    [self.contentView addSubview:self.school];
    [self.school release];
    
    self.hospital = [[UILabel alloc] initWithFrame:CGRectMake(10, 850, [UIScreen mainScreen].bounds.size.width - 10, 40)];
    self.hospital.numberOfLines = 0;
    [self.contentView addSubview:self.hospital];
    [self.hospital release];
    
    UILabel *mapLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 900, [UIScreen mainScreen].bounds.size.width - 10, 40)];
    mapLabel.text = @"去百度地图查看:";
    [self.contentView addSubview:mapLabel];
    [mapLabel release];
    
    self.map = [[UIImageView alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width / 2 - 20, 900, 40, 40)];
    [_map setBackgroundColor:[UIColor grayColor]];
    [_map setImage:[UIImage imageNamed:@"百度地图.jpg"]];
    _map.userInteractionEnabled = YES;
    _map.tag = 1000;
    [self.contentView addSubview:_map];
    [_map release];
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
